<template>
    <div class="indication">
        <div :class="['point', index == activeIndex ? 'active' : 'default']" v-for="(item, index) in length" :key="index"
            @click="changeIndex(index)">
        </div>
    </div>
</template>

<script setup lang="ts">
import { ref, reactive, toRefs } from "vue";
const props = defineProps({
    length: {
        type: Array,
        default: () => [1, 2, 3, 4, 5]
    },
    activeIndex: {
        type: Number,
        default: 1
    }
});
const emit = defineEmits(["change"]);
function changeIndex(index: number) {
    emit("change", index);
}
</script>

<style lang="less" scoped>
.indication {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    position: absolute;
    bottom: 3px;
    left: 0;
    right: 0;
    z-index: 9;

    .point {
        width: 6px;
        height: 6px;
        border-radius: 50%;
        cursor: pointer;
    }

    .active {
        background-color: var(--main);
    }

    .default {
        // border: 1px solid var(--color);
        background-color: rgba(73, 81, 89, 1);
    }
}
</style>
